﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>2.config.json模块配置</title>
    <script type="text/javascript" src="../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushJScript.js"></script>
    <link type="text/css" rel="stylesheet" href="../Content/highlighter/styles/shCoreDefault.css"/>
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
	<h3>模块配置</h3>
    <p>
    1.在模块根目录下config.json文件
    </p>
    <pre class="brush: javascript;">
    {
	  //本模块所有的URL前缀
	  "urlPrefix": "/App",
	  //本模块所有的Cookie前缀
	  "cookiePrefix": "App_",
	  //本模块所有的Session前缀
	  "sessionPrefix": "App_",
	  //默认样式
	  "defaultStyle": "Default",
	  //默认后缀
	  "urlExtension": ".htm",
	  //URL模式
	  "urlMode": 1,
	  //是否压缩HTML
	  "compressHTML": true,
	  //数据库配置
	  "connectionStrings": [
		{
		  "name": "Common",
		  "connectionString": "Data Source=|ModuleDataDirectory|Common.db;Pooling=true;FailIfMissing=false",
		  "providerName": "System.Data.SQLite"
		},
		{
		  "name": "SqlServer",
		  "connectionString": "Server=.\\SQLEXPRESS;Database=test;Uid=sa;Pwd=hayiaf;",
		  "providerName": "System.Data.SqlClient"
		},
		{
		  "name": "MySql",
		  "connectionString": "Server=localhost;Database=test;Uid=root;Pwd=root;",
		  "providerName": "MySql.Data.MySqlClient"
		},
		{
		  "name": "PostgreSql",
		  "connectionString": "Server=localhost;DataBase=postgres;Uid=postgres;Pwd=hayiaf;",
		  "providerName": "Npgsql"
		}
		,
		{
		  "name": "Oracle",
		  "connectionString": "Data Source==(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=c##sa;Password=hayiaf;",
		  "providerName": "Oracle.ManagedDataAccess.Client"
		}
	  ],
	  //静态路由重写配置
	  //目录重写
	  "rewriteDirectory": [
	  ],
	  //文件重写
	  "rewriteFile": [
		{"from": "/Index.html","to": "/App/IndexController/Index.html"}
	  ],
	  //缓存服务器
	  "redisServers": [
		{
		  "ip": "127.0.0.1",
		  "port": 6379
		}
	  ]
	}
    </pre>
</body>
</html>
